import java.io.File;
import javax.swing.filechooser.FileFilter;

public class FilterPublic extends FileFilter {
    
    public FilterPublic() {
    }
    
    public boolean accept(File f) {
        if (f.isDirectory()) {
            return true;
        }
        
        String extension = Utilities.getExtension(f);
        if (extension != null) {
            if (extension.equals("pub"))
                return true;
            else
                return false;
        }
        
        return false;
    }
    
    //The description of this filter
    public String getDescription() {
        return "*.pub (Public Key)";
    }
}
